package mi.payment.constants;

import java.util.HashMap;

import mi.payment.MyApplication;
import mi.payment.R;

/**
 * Created by sunmi on 2017/2/18.
 */

public class TransShortType {

    public static final String P = getResStr(R.string.pre_auth_type);//预授权
    public static final String PV = getResStr(R.string.pre_auth_cancel_type);//预授权撤销
    public static final String C = getResStr(R.string.pre_auth_complete_type);//预授权完成（请求）
    public static final String CV = getResStr(R.string.pre_auth_complete_cancel_type);//预授权完成撤销
    public static final String S = getResStr(R.string.consume_im_title_type);//消费
    public static final String SD = getResStr(R.string.cancellation_type);//消费撤销
    public static final String _R = getResStr(R.string.return_title_type);//退货


    public static final String AL = getResStr(R.string.ali_type);//支付宝消费
    public static final String AD = getResStr(R.string.ali_cancellation_type);//支付宝消费撤销
    public static final String AR = getResStr(R.string.ali_return_goods_type);//支付宝退货
    public static final String WX = getResStr(R.string.wei_chat_type);//微信消费
    public static final String WD = getResStr(R.string.wei_chat_cancellation_type);//微信消费撤销
    public static final String WR = getResStr(R.string.wei_chat_return_goods_type);//微信退货
    public static final String UX = getResStr(R.string.union_type);//银联扫码消费
    public static final String UD = getResStr(R.string.union_cancellation_type);//银联扫码消费撤销
    public static final String UR = getResStr(R.string.union_return_goods_type); //银联扫码退货
    public static final String MI = getResStr(R.string.mipay_type);//小米钱包消费
    public static final String MD = getResStr(R.string.mipay_cancellation_type);//小米钱包消费撤销
    public static final String MR = getResStr(R.string.mipay_return_goods_type);//小米钱包退货

    public static HashMap<String, String> type = new HashMap<String, String>();


    static {

        type.put("10", P);//预授权
        type.put("11", PV);//预授权撤销
        type.put("20", C);//预授权完成（请求）
        type.put("21", CV);//预授权完成撤销
        type.put("22", S);//消费
        type.put("23", SD);//消费撤销
        type.put("25", _R);//退货

        type.put("1+1", AL);//支付宝消费
        type.put("1+2", AD);//支付宝消费撤销
        type.put("1+3", AR);//支付宝退货
        type.put("2+1", WX);//微信消费
        type.put("2+2", WD);//微信消费撤销
        type.put("2+3", WR);//微信退货
        type.put("4+1", UX);//银联扫码消费
        type.put("4+2", UD);//银联扫码撤销
        type.put("4+3", UR);//银联扫码退货
        type.put("5+1", MI);//小米钱包消费
        type.put("5+2", MD);//小米钱包消费撤销
        type.put("5+3", MR);//小米钱包退货
    }

    private static String getResStr(int id) {
        return MyApplication.getInstance().getResources().getString(id);
    }


}
